#ifndef DATABASE_COLUMNSPEC_H
#define DATABASE_COLUMNSPEC_H
/*

*/


#include <cstddef>
#include <string>


namespace Database
{

using std::size_t;
using std::string;

class ColumnSpec
{
public:
	enum Type
	{
		INT_UNSIGNED,
		VARCHAR
	};

	enum Nullability
	{
	    NULLABLE,
	    NOT_NULLABLE
	};

	ColumnSpec(const Type type, const Nullability nullable, const string defaultValue, const bool defaultValueIsNull, const size_t maxByteLen = 0);
	virtual ~ColumnSpec();

	const Type type() const;
	const bool isNullable() const;
	const bool isVariableLength() const;
	const size_t maxByteLen() const;

	const string asString() const;
	static ColumnSpec fromString(string spec);

private:
	enum Type type_;
	Nullability nullability_;
	string defaultValue_;
	bool defaultValueIsNull_;
	size_t maxByteLen_;
};

}	// namespace Database

#endif

